#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include<assert.h>

char* my_strncpy(char* dest, const char* src, size_t num)
{
	assert(dest && src);
	char* ret = dest;
	while (num--)
	{
		*dest = *src;
		dest++;
		src++;
		if (*src == '\0')
		{
			*dest = *src;
			return ret;
		}
	}
	return ret;
}

int main()
{
	char arr[] = "asjfhasjkd";
	char arr2[20] = { 0 };
	printf("%s ", my_strncpy(arr2, arr, 6));


	return 0;
}